#!/bin/sh

cd bs_code

delete_folder() {
    local folder="$1"
    if [ -d "$folder" ]; then
        rm -r "$folder"
        echo "Folder '$folder' and its contents have been deleted."
    else
        echo "Folder '$folder' does not exist."
    fi
}

# 调用函数并指定要删除的文件夹路径
delete_folder "inequalities"

DIR_ENV=".env/"
if [ ! -d "$DIR_ENV" ]; then
    echo "Creating virtual enviroment ${DIR_ENV}..."
    python3 -m venv .env
fi

echo "Sourcing virtual enviroment.."
source ".env/bin/activate"

echo "Installing requirements.."
pip install -r requirements.txt

echo "Building and installing check_bp.."
cd check_bp && ./setup.sh
cd ..

cd ..

# echo "Building and installing rust_python_kyber.."
# cd rust_python_kyber && ./setup.sh
# cd ..
